home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Containers / SimpleApp / init.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-20  |  1.1 KB  |  61 lines  |  [TEXT/CWIE]

  1. #include "headers.h"
  2. #include "menus.h"
  3. #include "Protos.h"
  4. #include "CContainer.h"
  5. #include "CSimpleAppSite.h"
  6. #include "App.h"
  7.  
  8. AppData    gAppData = { NULL };
  9.  
  10. static void SetupMenus(void);
  11.  
  12. void Initialize(void)
  13. /*
  14.     Initialize Mac Tools and application values
  15. */
  16. {
  17.     short    i;
  18.     
  19.     InitGraf((Ptr) &qd.thePort);    /* Mac Tool Initializition */
  20.     InitFonts();
  21.     InitWindows();
  22.     InitMenus();
  23.     TEInit();
  24.     InitDialogs(0L);
  25.     InitCursor();
  26.     
  27.     MaxApplZone();            /* allocate master handles */            
  28.     for (i=1; i<=10; ++i)
  29.         MoreMasters();
  30.     
  31.     SetupMenus(); 
  32.     
  33.     gAppData.Window = GetNewCWindow(128, NULL, (WindowPtr) -1);
  34. #ifdef USE_OFFSCREEN
  35.     NewGWorld(&gAppData.Offscreen, 0, &gAppData.Window->portRect, NULL, NULL, 0);
  36. #endif // USE_OFFSCREEN
  37.     SetPort(gAppData.Window);
  38.     
  39.     InitApp(&gAppData);
  40.  
  41. void SetupMenus(void)
  42. /*
  43.     read a menubar from the resource fork and make it the current menu.
  44. */
  45. {
  46.     Handle        menuBar;
  47.  
  48.     /* Add the menu bar
  49.     */
  50.     menuBar = GetNewMBar(rMenuBar);        /*read menus into menu bar*/
  51.     SetMenuBar(menuBar);                    /*install menus*/
  52.     DisposHandle((Handle) menuBar);
  53.     
  54.     AddResMenu(GetMHandle(mApple), 'DRVR');    /*add DA names to Apple menu*/
  55.     
  56.     DrawMenuBar();
  57.         
  58.  
  59.